# 1.导包
import unittest

#2.创建测试套件对象
from unittestreport import TestRunner

import app
from script.test01_reg_login import TestRegLogin
from script.test02_open_account_api import TestOpenAccount
from script.test03_recharge import TestRecharge
from script.test04_tender_api import TestTender

suite = unittest.TestSuite()
# 3.添加测试用例到测试套件  生成测试报告
suite.addTest(unittest.makeSuite(TestRegLogin))
suite.addTest(unittest.makeSuite(TestOpenAccount))
suite.addTest(unittest.makeSuite(TestRecharge))
suite.addTest(unittest.makeSuite(TestTender))
rep_file = app.BASE_PATH + "/report/p2p.html"
runner = TestRunner(suite,rep_file,title="p2p金融项目测试报告",  #标题
                    tester="金融项目", #测试人员
                    desc="v1.0",  #描述信息
                    templates=1)
runner.run()

#另一种
#导包
# import unittest
# # 实例化测试套件
# suite = unittest.TestSuite()
# # 添加测试类
# suite.addTest(unittest.makeSuite(TestRegLogin))
# suite.addTest(unittest.makeSuite(TestOpenAccount))
#
# # 实例化TextTestRunner类
# runner =unittest.TextTestRunner()
# # 运行测试套件
# runner.run(suite)